package com.example.cmtwo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BackMapper {

    //@Options注解，告诉程序Aid字段为自增模式，无需导入
    @Options(useCache = true,keyColumn = "Aid")
    @Insert("insert into advise(Uid, funtion, phone, content) value(#{Uid},#{funtion},#{phone},#{content})")
    public int insertAdvise(@Param("Uid") Integer Uid, @Param("funtion") String funtion,
                            @Param("phone") Integer phone, @Param("content") String content)throws Exception;

    @Options(useCache = true,keyColumn = "Rid")
    @Insert("insert into report(Uid, who, type, phone, why) value(#{Uid},#{who},#{type},#{phone},#{why})")
    public int insertReport(@Param("Uid") Integer Uid, @Param("who") Integer who, @Param("type") String type,
                            @Param("phone") Integer phone, @Param("why") String why)throws Exception;
}
